import 'dart:async';

import 'package:flutter_ok/route/routes.dart';
import 'package:flutter_ok/manager/account_manager.dart';
import 'package:get/get.dart';

class SplashController extends GetxController {
  @override
  void onReady() {
    super.onReady();
    Timer.periodic(Duration(milliseconds: 2500), (t) {
      if (AccountManager.instance.isLogin()) {
        Get.offAllNamed(Routes.home);
      } else {
        Get.offAllNamed(Routes.home);
      }
      t.cancel();
    });
  }
}
